package web.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import web.mapper.TeacherMapper;
import web.pojo.Teacher;

@Service
public class TeacherService {

    @Autowired
    TeacherMapper mapper;

    /**
     * 获取当前登录人员信息
     *
     * @param id 根据id获取请求
     * @return
     */
    public Teacher findTeacherInfoById(Long id) {
        Teacher stu = mapper.findTeacherInfoByUserId(id);
        return stu;
    }

    public List<Teacher> findAllTeacher() {
        try {
            return mapper.findTeachers();
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return new ArrayList<>();
        }
    }
}
